// 课程介绍模块的接口
import request from '../utils/request'

// 请求课程详细信息 --登录后
export const getCourseOnLogin=(courseId)=>{
	return request("/Handler/OfflineCourseHandler.ashx?action=learnshow","post",{
		courseId:courseId
	})
}

// 请求课程详细信息 --未登录
export const getCourseOffLogin=(courseId)=>{
	return request("/Handler/OnCourseHandler.ashx?action=learnshow","post",{
		courseId:courseId
	})
}

// 获取课程目录列表接口
export const getCouseDir=(CDid)=>{
	return request("/VideoHandler?action=finddir","get",{
		CDid:CDid
	})
}
// 获取目录下视频的接口
export const getDirVideo=(CDid,_id)=>{
	return request("/VideoHandler?action=showdir","get",{
		_id:_id,//目录id
		CDid:CDid//课程的ID
	})
}
// 收藏接口
export const toCollect=(courseId,userName)=>{
	return request("/Handler/OnCourseHandler.ashx?action=collection","post",{
		courseId:courseId,
		userName:userName
	})
}
// 购买接口
export const toBuyApi=(courseId,userName)=>{
	return request("/Handler/OnCourseHandler.ashx?action=buy","post",{
		courseId:courseId,
		userName:userName
	})
}
// 评价接口
export const toPjApi=(data)=>{
	return request("/Handler/OnCourseHandler.ashx?action=addcoursecomments","post",data)
}